home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / compiler / Lambda.sml < prev    next >
Encoding:
Text File  |  1997-08-18  |  831 b   |  36 lines  |  [TEXT/R*ch]

  1. (* The intermediate language: extended lambda-calculus in de
  2.     Bruijn's notation *)
  3.  
  4. local
  5.   open Const Prim;
  6. in
  7.  
  8. datatype Lambda =
  9.     Lvar of int
  10.   | Lconst of StructConstant
  11.   | Lapply of Lambda * Lambda list
  12.   | Lfn of Lambda
  13.   | Llet of Lambda list * Lambda
  14.   | Lletrec of Lambda list * Lambda
  15.   | Lprim of primitive * Lambda list
  16.   | Lcase of Lambda * (SCon * Lambda) list
  17.   | Lswitch of int * Lambda * (BlockTag * Lambda) list
  18.   | Lstaticfail
  19.   | Lstatichandle of Lambda * Lambda
  20.   | Lhandle of Lambda * Lambda
  21.   | Lif of Lambda * Lambda * Lambda
  22.   | Lseq of Lambda * Lambda
  23.   | Lwhile of Lambda * Lambda
  24.   | Landalso of Lambda * Lambda
  25.   | Lorelse of Lambda * Lambda
  26.   | Lunspec
  27.   | Lshared of Lambda ref * int ref
  28.   | Lassign of int * Lambda
  29. ;
  30.  
  31. fun shared_lambda lam =
  32.   Lshared( ref lam, ref Instruct.Nolabel )
  33. ;
  34.  
  35. end;
  36.